Repository navigation
Conversation
A code read whose namespace had no repository entry fell back to the deployment's scalar entry's mirror (`LOOM_CODE_*`) without checking the org or namespace, so a caller in any org could read that repository's history through code.blame_range, code.bisect_candidates, code.verify_citations and code.first_build, and a namespace of the scalar entry's org could read it through `at_commit`. `mirrors.history_dir` answers `no_git_mirror: the namespace has no repository entry` for an entry-less namespace, and every history read goes through it. `repos.default_git_dir` and `blame.history_git_dir` are deleted. `at_commit` refuses an entry-less namespace as naming no repository, code.reindex refuses one (it has no watermark to move), and code.index_status names no repository or branch for one. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Lareb Zafar <lareb.zafar@clickhouse.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
…r entry code.conventions compared a ledger row's target branch with the scalar entry's branch (`LOOM_CODE_GIT_BRANCH`) for a namespace with no entry, so a PR merged into another branch read as off the namespace's branch and its bugfix_has_test and stateless_test_number verdicts became not_applicable. Such a namespace has no branch, and the target branch is compared only when there is one. A code.index_status commit check of a namespace with no entry passed the status stand-in to history_dir and answered that it names no remote; it passes the entry, so the check names the missing entry. code.reindex of such a namespace answers 404, as code.refresh does. The None guards and scalar-branch fallbacks the deleted mirror fallback left in blame, bisect, citations and conventions are removed. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Lareb Zafar <lareb.zafar@clickhouse.com>
…ry text Every other history read answers a namespace no repository entry indexes with `no_git_mirror: the namespace has no repository entry`; `at_commit` said "the namespace names no repository". It raises `mirrors.NO_REPO_ENTRY`, and its one-caller `_mirror` helper is inlined into `resolve`, so the retry-or-refuse decisions read in one place. The conventions test covers a namespace in another org and one in the scalar entry's org, with a positive control on an entry's own branch. The integration test builds the mirror of the entry `repos.config_entry` names for the deployment's code namespace, so a `LOOM_CODE_REPOS_JSON` entry that replaces the scalar one is the one it reads. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Lareb Zafar <lareb.zafar@clickhouse.com>
… and repo Outside `repos.py` and the settings, no server module reads `code_git_branch` or `code_git_remote`; the gate now lists them beside `code_git_dir` and `_scalar_repo`. `code_repo` also names local variables, so only an attribute read of it counts. The `at_commit` docstring states when a read is refused as the operations page does: a commit the mirror lacks is refused for every entry, and what the mirror lacks is refused when this host neither clones nor fetches it. The `at_commit` test reaches the unpatched `history_dir` through `_HISTORY_DIR` alone, and two edited texts are wrapped to their paragraphs. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Lareb Zafar <lareb.zafar@clickhouse.com>
… text `code.bisect_candidates` with `bad_sha` and no `before` answered a namespace no repository entry indexes with "<ns> has no repository mirror to resolve <sha>". The pre-check is deleted: `history_dir(None)` answers `no_git_mirror: the namespace has no repository entry`, and the refusal keeps `BAD_SHA` and its "pass `before` as a time instead". `bisect._attach_merge_shas` is keyed on the mirror `history_dir` returns rather than on the entry, so with no mirror on this host it skips the indexed-head read the mirror search alone uses. The repository-snapshot gate's predicate is a function with a probe: a `settings.code_git_branch` or `settings.code_repo` read is flagged, and a local variable named `code_repo` is not. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Lareb Zafar <lareb.zafar@clickhouse.com>
…remote server The integration test's positive read runs first: when it answers `no_git_mirror:`, the server under test does not see this checkout's mirror, so the test skips rather than passing the entry-less cases on a server that reads no mirror at all. The repository-snapshot gate counts a `getattr` of the raw configuration by a literal name, with a probe. `mirrors.NO_REPO_ENTRY` is exported, `dupcheck_links` drops a guard `history_dir(None)` already covers, and `_attach_merge_shas` sets the mirror and the ref on separate lines. The operations page says a namespace no entry indexes is refused for any commit but the indexed head's, and the architecture page says the no-entry text is `history_dir`'s answer and that the PR overlay answers `overlay_note: no_repo_entry` before it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Lareb Zafar <lareb.zafar@clickhouse.com>
`_history_stage` asked `history_dir` only when the namespace had an entry, so with `history=true` a namespace no repository entry indexes read branches from an empty mirror path and each row said `no_branch_ref`. It now asks `history_dir` either way, and the rows carry `no_git_mirror: the namespace has no repository entry`. The isolation test also skips when the entry's own read answers `no_git_history:` (a host that keeps no mirrors), and it removes the directories it made for the mirror once they are empty. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Lareb Zafar <lareb.zafar@clickhouse.com>
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Changelog category (leave one):
Changelog entry (one or two sentences a user of Loom can read without the diff; the release pull request collects these into the release notes):
A code read from any org, naming a namespace without a repository entry, no longer answers from the deployment's default repository mirror (blame, PR numbers, commit subjects, diffs).
Why
A code read resolves its git mirror from the namespace's repository entry. When the namespace had no entry, four sites fell back to the scalar entry's mirror (
LOOM_CODE_*, throughrepos.default_git_dir()), and the fallback did not check the caller's org or namespace:blame.history_git_dir, whichcode.blame_range,code.first_buildand the mark and fix-blame stages ofcode.bisect_candidatesread throughcode.bisect_candidates(bisect._attach_merge_shas)code.verify_citations(citations._git_legs)at_commitreads ofcode.tests_forandcode.test_gate(at_commit._mirror), limited to the scalar entry's orgSo a caller in any org, naming a namespace no entry indexes, got the history of the scalar entry's repository: PR numbers, commit subjects, blame and diff marks. The history bound did not limit it: a namespace with no indexed head is unbounded, and
from_sha/to_shaname the window directly.The fix deletes the fallback.
mirrors.history_dir(None)answersno_git_mirror: the namespace has no repository entry, every history read goes throughhistory_dir, and the wrappers that existed only for the fallback are deleted (repos.default_git_dir,blame.history_git_dir). An entry-less read then takes the paths a namespace without a mirror already takes.The scalar entry's branch (
LOOM_CODE_GIT_BRANCH) is not applied to a namespace with no entry either.code.conventionscompared a ledger row'starget_branchwith it, so a PR the ledger says merged into another branch read as off the namespace's branch. A namespace with no entry has no branch, andtarget_branchis compared only when there is one. Outsiderepos.py, no server code readscode_git_branch, and the repository-snapshot gate now enforces it. Thecfg is not Noneguards that only the fallback reached are removed fromblameandcitations: past the mirror gate, the namespace has an entry.bisect._attach_merge_shasis keyed on the mirrorhistory_dirreturns instead: with no entry, or no mirror on this host yet, it returns the ledger's merge shas and skips the indexed-head read, which the mirror search alone uses.dupcheck_linksdrops a guardhistory_dir(None)already covers.at_commit,bad_shaoncode.bisect_candidatesand the history stage ofcode.backport_gapanswer an entry-less namespace with the same text as every other site,no_git_mirror: the namespace has no repository entry.Scope and risk
code.blame_range,code.bisect_candidates(marks, merge shas, fix blame),code.first_build,code.verify_citations,code.conventions,code.backport_gap(history=true),at_commitoncode.tests_forandcode.test_gate,code.reindexandcode.index_status.code.reindexwrotegit_headto any namespace. No ingest walks a namespace with no entry, so it answers that namespace as not configured (404), ascode.refreshdoes.code.index_statusof a namespace with index rows but no entry named the scalar entry's repository and branch. It names none. Itscommitcheck named the status stand-in's missing remote; it names the missing entry.loom code backfillwith no--namespace, whenLOOM_CODE_NAMESPACEhas no entry, indexes the first configured entry under the deployment's code namespace. That is an operator command run with deployment credentials, not a read path; it never depended on this fallback.Compatibility, rollout and rollback
code.blame_range,code.first_build,code.verify_citationsand thecode.bisect_candidatesmarks and fix-blame stage answer with the gapno_git_mirror: the namespace has no repository entryand read no mirror. On a host with git history off (LOOM_GIT_HISTORY=none),code.blame_rangeanswersno_git_historyfirst, as before.code.backport_gapwithhistory=truegives each branch row's history the reasonno_git_mirror: the namespace has no repository entry. It gaveno_branch_ref.code.conventionsnotesno_git_mirror: the namespace has no repository entry: diff-dependent rules are unknownand sets nooff_branchfrom the scalar entry's branch, sobugfix_has_testandstateless_test_numberare judged as for a PR on the namespace's own branch. Its ledger reads drop the branch filter too, since an empty branch adds notarget_branchpredicate: thechangelog_categorycensus and thestateless_test_numberfirst-owner lookup count the namespace's ledger rows of every branch.at_commit, for a namespace with an indexed head, still answers the indexed head's full sha with no mirror read, and is refused for any other commit with 422 "at_commitreads the namespace's git mirror: no_git_mirror: the namespace has no repository entry" in every org, the scalar entry's included. A namespace with no indexed head still answers "the namespace has no indexed head" first.code.bisect_candidateswithbad_shaand nobeforeanswers 422BAD_SHA"no_git_mirror: the namespace has no repository entry; passbeforeas a time instead". It said " has no repository mirror to resolve ".code.reindexanswers 404RESOURCE_NOT_FOUND"namespace / has no repository entry, so no ingest walks it".code.index_statusanswers an emptyrepoandbranch,providergitandprofilegeneric(they were derived from the scalar entry's repository), and acommitcheck waits oncommit not checked: no_git_mirror: the namespace has no repository entry. With an empty branch, a publishedclone_headrow (which names its branch) and the published lags no longer match, soclone_headis empty and the lags read -1 (unknown).LOOM_CODE_REPOS_JSONor the self-service registry).docs/reference/operations/code.mdreverts with the rest.Tests
mainand passing here. Each runs an entry-less namespace in another org and one in the scalar entry's org, except two single cases:test_code_bisect_before.py, withrepo_for_namespacestubbed to None, andtest_code_backport_gaps.py, an unlisted namespace of the entry's org. The blame range, mirrors, first build, citations andat_committests assert that git never runs with the scalar entry's directory and that the scalar entry's own namespace still reads it. The conventions positive control is a stub entry (_Cfg) onmaster, and the reindex file has a separate test for the entry's own namespace:tests/unit/test_code_blame_range.pytests/unit/test_mirrors.py(bisect marks, merge shas, fix blame)tests/unit/test_code_first_build.pytests/unit/test_code_verify_citations_resolve.pyandtests/unit/test_code_at_commit.py, whose positive control reads the scalar entry's mirror through the unpatchedhistory_dirtests/unit/test_code_conventions.py: withLOOM_CODE_GIT_BRANCH=masterand a ledger row merged intomain,bugfix_has_testisviolated, notnot_applicable. Its positive control, an entry onmaster, reads the same row asnot_applicablewith the note "merged into main, not master"; forcing the branch to""inconventions.pyfails it.tests/unit/test_code_reindex_scope.py(404)tests/unit/test_code_bisect_before.py:bad_shain a namespace with no entry answersBAD_SHAwith the shared text, runs no git and scans nothing. Onmainit gets "code-clickhouse has no repository mirror to resolve 'abc1234'".tests/unit/test_code_status_ops.py(repository, branch and thecommitcheck)tests/unit/test_code_backport_gaps.py: the history stage of a namespace with no entry names the missing entry on each branch row; the entry's own namespace reads its release branch on a real mirror and decidesgap. Onmainthe row saysno_branch_ref.tests/unit/test_code_bisect_frameless.pygives its namespace an entry with a mirror. The test then shows that the frameless pool alone keeps the diffs from running; onmainthe missing mirror did.tests/unit/test_code_bisect_deadline.pygives its namespace an entry too, whose mirrorhistory_dirserves. Without one, the fix-blame stage stops at the gap before it reaches the slow blame the test times.tests/unit/test_repo_snapshot_contract.pynow listscode_git_branchandcode_git_remotebesidecode_git_dirand_scalar_repo, and an attribute read ofcode_repo: outsiderepos.pyand the settings, no server module reads them. Agetattrof any of them by a literal name counts too. A probe in the test asserts thatsettings.code_git_branch,settings.code_repo,getattr(settings, 'code_git_remote')andgetattr(settings, 'code_repo', '')are flagged and that a local variable namedcode_repois not.tests/integration/test_code_default_mirror_isolation.pybuilds a bare mirror at the clone path of the entry of the deployment's code namespace (repos.config_entry; skipped when no entry indexes it), with a commit squash-merged as PR 7 whose subject carries a nonce. It first callscode.blame_rangeover HTTP as the deployment's code namespace, which gets PR 7; when that read answersno_git_mirror:(the server does not see this checkout's mirror) orno_git_history:(the host keeps no mirrors), the test skips. It removes the mirror, and the directories it made for it once they are empty. It then calls it from another org and from an unlisted namespace of the same org. Both answer the gap with no candidates and no nonce. Against a server runningmainboth cases fail: the window resolves on the scalar entry's mirror. Against this branch, on a ClickHouse started for the run, the file passes (2 passed).make format lint typecheckpass. The code-plane unit files this change touches (blame, bisect, merge shas, sha inputs, duplicate-check links, citations, conventions, first build, status,at_commit, reindex, mirrors, test gate, tests for) and the copy, link, inventory, package-contract and repository-snapshot gates: 1599 passed. 5 failed intests/unit/test_mirror_names_refused.py, a migration test that runs SQL through the localclickhousebinary, which rejects the settingenable_quantized_codec; the test reads none of the code this change touches.AI assistance in the code (leave one; writing this description with AI is fine):
AI-generated (an agent wrote most of the diff): Claude Code. The diagnosis, each site's test failing on
mainand the integration run against both builds were checked before the push.I can explain every line of this diff and how it interacts with the rest of Loom.
Checklist
make test-unitand applicable integration results are reported by CI; a full local run is not required before pushing.docs/reference/configuration.mdand thedocs/reference/tables (python scripts/codegen/docs_reference.py), the reach manifest,schemas/schema.sql(make schema-dump), the Codex plugin copies (python3 scripts/codegen/agent_plugin_sync.py) and the standalone skill bundles (python3 scripts/codegen/standalone_skills.py).main; no merged migration is edited.hooks/,lib/,bin/,skills/,.mcp.json, the Codexplugin-defaults.json) bumps both plugin manifests' version, and no other open PR uses that version.npm --prefix frontend run build) and its tests pass, iffrontend/changed.docs/describe the system as it now is, and this description names any operator steps and wire changes.tests/unit/test_public_copy.py).git commit -s), as CONTRIBUTING.md asks.🤖 Generated with Claude Code